xm: When dumping core of an errant domain do not unpause after the
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 4 Apr 2008 09:18:45 +0000 (10:18 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 4 Apr 2008 09:18:45 +0000 (10:18 +0100)
dump. This could allow the domain to e.g., access disks after
fail-over.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xm/main.py

index 8a161e6f7f2816ced72810b0b45bb7dda7dbb0cd..f5ad85d38157f955aef06120f7805429418732ed 100644 (file)
@@ -1294,14 +1294,14 @@ def xm_dump_core(args):
     try:
         print "Dumping core of domain: %s ..." % str(dom)
         server.xend.domain.dump(dom, filename, live, crash)
+
+        if crash:
+            print "Destroying domain: %s ..." % str(dom)
+            server.xend.domain.destroy(dom)
     finally:
-        if not live and ds == DOM_STATE_RUNNING:
+        if not live and not crash and ds == DOM_STATE_RUNNING:
             server.xend.domain.unpause(dom)
 
-    if crash:
-        print "Destroying domain: %s ..." % str(dom)
-        server.xend.domain.destroy(dom)
-
 def xm_rename(args):
     arg_check(args, "rename", 2)